package com.lsongh.springBoot.controller;

import com.lsongh.springBoot.entity.Country;
import com.lsongh.springBoot.entity.Result;
import com.lsongh.springBoot.service.CountryService;
import com.lsongh.springBoot.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CountryController {
    @Autowired
    CountryService countryService;

    /**
     * 获取所有国家的信息
     * @return
     */
    @RequestMapping(value = "/country",method = RequestMethod.GET)
    public Result<Country> getAllCountry(){
        return ResultUtil.success(countryService.findAll());
    }
}
